<template>
	<view>
			<p style="margin: 7rpx 10rpx 7rpx;">当前周数：{{currentWeekNumber}}</p>
			<wyb-table first-line-fixed 
			:font-size="[25]"  
			:headers="columns" 
			@onCellClick="celldata"
			:contents="timeList.filter(f=>f.day==currentWeekNumber)"  />
			<u-gap height="15" margin-top="10" margin-bottom="10" bg-color="#bbb"></u-gap>
			<u-grid :col="5">
				<u-radio-group  v-model="currentWeekNumber">
				<u-grid-item v-for="item in sumtWeekNumber" :key="item" >
					<u-radio :name="item" >{{item}}</u-radio>
				</u-grid-item>
				</u-radio-group>
			</u-grid>
			<drag-button :isDock="true" ></drag-button>
	</view>
</template>

<script>
import wybTable from '../../components/wyb-table/wyb-table.vue'
import dragButton from '../../components/drag-button/drag-button.vue'
	export default{
		components:{wybTable,dragButton},
		data(){
			return{
				classId:null,
				taskTeacherId:null,
				currentWeekNumber:null??"一",
				sumtWeekNumber:["一","二","三","四","五","六","七","九","十","十一","十二","十三","十四","十五","十六","十七","十八"],
				columns:[
					{
						label: "/",
						key: "time",
						width:50
					},
					{
						label: "一",
						key: "monday_place",
						width:150
					
					},
					{
						label: "二",
						key: "tuesday_place",
						width:150
					
					},
					{
						label: "三",
						key: "wednesday_place",
						width:150
					
					},
					{
						label: "四",
						key: "thursday_place",
						width:150
					
					},
					{
						label: "五",
						key: "friday_place",
						width:150
					
					},
					{
						label: "六",
						key: "saturday_place",
						width:150
					},
					{
						label: "日",
						key: "sunday_place",
						width:150
					},
				],
			}
		},
		methods:{
			celldata(val){
				console.log(val)
			}
		},
		onLoad(item) {
			this.classId = item.classId
			this.taskTeacherId = item.taskTeacherId
		},
		computed:{
			timeList(){
				return this.$store.state.myTaskList?.
				find(f=>f.taskTeacherId == this.taskTeacherId).taskDO.classDOList?.
				find(f=> f.classId == this.classId).list
			}
		},
		created() {
			
		}
	}
	
</script>

<style>
</style>
 